#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
#include "errsys.h"

#define BUFSIZE 4096

int main(int argc, char **argv)
{
  FILE *fp;
  char buf[BUFSIZE];
  ssize_t sz;
  int c;

  if(argc != 2){
    printf("cmd file\n");
    exit(1);
  }

  fp = fopen(argv[1],"r");
  if(!fp)
    err_sys("Open error");

  while( (c=getc(fp)) != EOF)
	  if( putc(c, stdout) == EOF )
		  err_sys("Error");
  if(ferror(fp))
	  err_sys("input error");

  fclose(fp);
  return 0;
}

